package com.ruoyi.planthopper.service.Impl;

import com.ruoyi.planthopper.domain.InvesInfo;
import com.ruoyi.planthopper.domain.QueryCondition;
import com.ruoyi.planthopper.domain.WebPlotInfo;
import com.ruoyi.planthopper.mapper.InvesMapper;
import com.ruoyi.planthopper.service.InvesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: class by cxf
 * @author: AbrahamBill
 * @date: 2022/7/22
 **/
@Service
public class InvesServiceImpl implements InvesService {
    @Autowired
    private InvesMapper invesMapper;

    public List<InvesInfo> selectInvesList(QueryCondition queryCondition){
        return invesMapper.selectInvesList(queryCondition);
    }

    public int insertInvesInfo(InvesInfo invesInfo){
        return invesMapper.insertInvesInfo(invesInfo);
    }

    public List<String> selectPlotNameByUser(String userName){
        return invesMapper.selectPlotNameByUser(userName);
    }

    public List<InvesInfo> selectInvesListWeb(QueryCondition queryCondition){
        List<InvesInfo> lst = invesMapper.selectInvesList(queryCondition);
        for(InvesInfo info:lst){
            info.initDisplayFileName();
        }
        return lst;
    }
    public int deleteMyImgById(int id){
        return invesMapper.deleteMyImgById(id);
    }

    public List<WebPlotInfo> selectPlotNameByUser2(String userName){
        return invesMapper.selectPlotNameByUser2(userName);
    }

    public int deleteMyPlotById(int id){
        return invesMapper.deleteMyPlotById(id);
    }

    public int deleteInvesInfoById(int id){
        return invesMapper.deleteInvesInfoById(id);
    }
}
